/*
 * IPPool.java Created on 27 Январь 2006 г., 3:28 To change this template, choose Tools | Template Manager and open the
 * template in the editor.
 */

package org.dicr.util.net.ippool;

import org.dicr.util.data.exc.*;
import org.dicr.util.net.*;

/**
 * IP Pool This is the pool of IP addresses, which manage the allocation and freing of addresses.
 * 
 * @author Igor A Tarasov &lt;java@dicr.org&gt;
 * @version 060125
 */
public interface IPPool {
	/**
     * Allocate IP-address from pool.
     * 
     * @return allocated ip-address (never null)
     * @throws DataException if none free addresses to allocate or data load problem
     */
	public IP allocate() throws DataException;

	/**
     * Free IP-address back to pool.
     * 
     * @param ip IP-address to free
     * @throws DataException store problem
     */
	public void free(IP ip) throws DataException;

	/**
     * Deallocate (free) all IP-addresses to pool.
     * 
     * @throws DataException store problem
     */
	public void reset() throws DataException;
}
